package com.nsgf.library.ui;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.kunminx.architecture.ui.page.DataBindingConfig;
import com.nsgf.library.BR;
import com.nsgf.library.R;
import com.nsgf.library.data.bean.UserInfo;
import com.nsgf.library.ui.page.BaseActivity;
import com.nsgf.library.ui.page.StateHolder;

public class UserInfoActivity extends BaseActivity {

    StateHolder mState;

    @Override
    protected void initViewModel() {
        mState = getActivityScopeViewModel(StateHolder.class);
    }

    @Override
    protected DataBindingConfig getDataBindingConfig() {
        return new DataBindingConfig(R.layout.activity_user_info, BR.vm, mState);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mState.titleBar.set("个人信息");
        mState.name.set(UserInfo.getInstance().getName());
        mState.phone.set(UserInfo.getInstance().getPhone());
        mState.position.set(UserInfo.getInstance().getDeptName());
    }
}
